package com.cnzhy.esclientrhl.index;

import lombok.Data;
import org.zxp.esclientrhl.annotation.ESID;
import org.zxp.esclientrhl.annotation.ESMapping;
import org.zxp.esclientrhl.annotation.ESMetaData;
import org.zxp.esclientrhl.enums.DataType;

import java.util.Date;

/**
 * @program: esclientrhlDemo
 **/
@ESMetaData(indexName = "index_demo", number_of_shards = 3, number_of_replicas = 0, printLog = true)
@Data
public class IndexDemo {
    @ESID
    private String proposalNo;

    @ESMapping(datatype = DataType.keyword_type)
    private String risk_code;

    @ESMapping(datatype = DataType.text_type)
    private String risk_name;

    @ESMapping(keyword = true)
    private String business_nature;

    @ESMapping(datatype = DataType.text_type)
    private String business_nature_name;

    private String appli_code;//可以用默认值，这样会有appli_code.keyword可以直接搜

    @ESMapping(suggest = true)
    private String appli_name;

    private String insured_code;

    @ESMapping(ngram = true)
    private String insured_name;

    @ESMapping(datatype = DataType.date_type)
    private Date operate_date;

    @ESMapping(datatype = DataType.keyword_type)
    private String operate_date_format;

    @ESMapping(datatype = DataType.date_type)
    private Date start_date;

    @ESMapping(datatype = DataType.date_type)
    private Date end_date;

    @ESMapping(datatype = DataType.double_type)
    private double sum_amount;

    @ESMapping(datatype = DataType.double_type)
    private double sum_premium;

    @ESMapping(datatype = DataType.keyword_type)
    private String com_code;
}
